package com.wiscamp.ninechapters.problems.application.assemblers;

import com.wiscamp.ninechapters.problems.application.dto.commands.mistakes.MistakeQuantityBySetTypeDto;
import com.wiscamp.ninechapters.problems.application.dto.vo.mistakes.MistakeQuestionVO;
import com.wiscamp.ninechapters.problems.application.dto.vo.sheets.MistakeVO;
import com.wiscamp.ninechapters.problems.domain.models.mistakes.Mistake;
import com.wiscamp.ninechapters.problems.domain.models.mistakes.MistakeQuantityBySetType;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface MistakeAssembler {
    MistakeAssembler Instance = Mappers.getMapper(MistakeAssembler.class);

    @Mapping(source = "mistakeId", target = "mistakeId")
    MistakeVO toMistakeVO(Mistake entity);

    Mistake toMistake(MistakeVO vo);

    MistakeQuantityBySetTypeDto toMistakeQuantityBySetTypeDto(MistakeQuantityBySetType mistakeQuantityBySetType);

    MistakeQuestionVO toMistakeQuestionDto(Mistake entity);
}
